#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 struct TreeNode {
     int val;
     struct TreeNode *left;
     struct TreeNode *right;
 };

void pre(struct TreeNode* root, int* arr, int* returnSize)
{
	if (root == NULL)
		return;
	arr[*returnSize] = root->val;
	(*returnSize)++;
	pre(root->left, arr, returnSize);
	pre(root->right, arr, returnSize);
}
int* preorderTraversal(struct TreeNode* root, int* returnSize) {
	int* arr = (int*)malloc(100 * sizeof(int));
	*returnSize = 0;
	pre(root, arr, returnSize);
	return arr;
}
int main()
{
	return 0;
}